
/*  设置历史记录缓存  */
function setHistoryStorage(val) {
	let value = uni.getStorageSync('historyList')
	let arr = []
	if(value.length == 0){
		arr.push(val)
	}else{
		for (let i = 0; i < value.length; i++) {
			if(value[i] == val){
				value.splice(i,1)
			}
		}
		if(value.length >= 20){
			value.splice(19,1)
		}
		arr.push(val)
		arr = arr.concat(value)
	}
	uni.setStorageSync('historyList', arr)
}

export {
	setHistoryStorage
}